package cn.gene.timeyan.search.webapi.controller;

import cn.gene.timeyan.common.restful.JsonPage;
import cn.gene.timeyan.common.restful.JsonResult;
import cn.gene.timeyan.pojo.search.entity.SeaEntity;
import cn.gene.timeyan.pojo.search.entity.ShareEntity;
import cn.gene.timeyan.search.service.ISearchService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * 搜索模块*
 *
 * @author LWG
 * @date 2022/7/21 21:35
 * @since 1.0.0@gene.cn
 */
//@RestController
//@RequestMapping("/search")
//@Api(tags = "搜索模块")
//public class SearchController {
//    @Autowired(required = false)
//    private ISearchService iSearchService;
//
//    // 搜索模块最主要的功能就是实现搜索
//    // 面对这种功能对应的控制器方法,可以不写任何路径
//    // 按下面@GetMapping注解表示当前控制路径为localhost:10008/search
//    @GetMapping("/cooperation")
//    @ApiOperation("根据关键字查询ES中的信息")
//    @ApiImplicitParams({
//            @ApiImplicitParam(value = "搜索关键字",name = "keyword",dataType = "string",
//                    required = true),
//            @ApiImplicitParam(value = "页码",name = "page",dataType = "int",
//                    required = true),
//            @ApiImplicitParam(value = "每页条数",name = "pageSize",dataType = "int",
//                    required = true)
//    })
//    public JsonResult<JsonPage<SeaEntity>> searchByKeyword(
//            String keyword,
//            @RequestParam(value = "page",defaultValue = "1")Integer page,
//            @RequestParam(value = "pageSize",defaultValue = "2") Integer pageSize
//    ){
//        JsonPage<SeaEntity> list=iSearchService.search(keyword,page,pageSize);
//        return JsonResult.ok(list);
//    }
//    @GetMapping("/keyWord")
//    @ApiOperation("获取关键字")
//    @ApiImplicitParam(value = "搜索关键字",name = "keyword",dataType = "string",
//            required = true)
//    public JsonResult<String> getKeyword(
//            String keyword
//    ){
//        String keyWord=iSearchService.getKeyWord(keyword);
//        return JsonResult.ok(keyWord);
//    }
//
//}
//
//
